import request from '@/utils/request'

// 获取企业列表
export const getCompanyListAPI = params => request({
  url: '/park/enterprise',
  params
})

// 文件上传
export const uploadFileAPI = data => request({
  url: '/upload',
  method: 'POST',
  data
})

// 获取行业列表
export const getIndustryListAPI = () => request({
  url: '/park/industry'
})

// 新增企业
export const addCompanyAPI = data => request({
  url: '/park/enterprise',
  method: 'POST',
  data
})

// 获取企业详情
export const getCompanyDetailAPI = id => request({
  url: `/park/enterprise/${id}`
})

// 编辑企业
export const editCompanyAPI = data => request({
  url: '/park/enterprise',
  method: 'PUT',
  data
})

// 删除企业
export const delCompanyAPI = id => request({
  url: `/park/enterprise/${id}`,
  method: 'DELETE'
})

// 增加租赁合同
export const addContractAPI = data => request({
  url: '/park/enterprise/rent',
  method: 'post',
  data
})

// 获取企业租赁信息
export const getContractListAPI = id => request({
  url: `/park/enterprise/rent/${id}`
})

// 退租
export const outRentAPI = id => request({
  url: `/park/enterprise/rent/${id}`,
  method: 'put'
})

// 查看企业
export const getEnterpriseAPI = id => request({
  url: `/park/enterprise/${id}`
})
